
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n,j=1;
	int m = 1, s = 0;
	scanf("%d",&n);
	if (n <= 20) {
		for (j = 1; j <= n; j++)
		{
			m = m * j;
			s += m;
		}
	}
	printf("%d\n", s);
	return 0;
}